﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index1.aspx.cs" Inherits="AnyOffice.general.notify.show.index1" %>
<%@ Register TagPrefix="Webdiver" Namespace="Webdiver" Assembly="AspnetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>按类型显示公告通知</title>
		
		<script type="text/javascript" Language="JavaScript">
		window.setTimeout('this.location.reload();',120000);
		</script>
		<script type="text/javascript" language="javascript">
        function open_notify(notify_id)
        { 
         var mwidth = "500";
         var mheight = "400";
         var loc_x = parseInt((window.screen.width - mwidth) / 2);
         var loc_y = parseInt((window.screen.height - mwidth) / 2);

         var _oParameter = new Object();
         _oParameter.dialogTitle = "消息管理";
         _oParameter.openFile ="read_notify.aspx?notify_id="+notify_id+"&num=" + Math.random();

         window.showModalDialog('shDialog.htm', _oParameter, 'dialogHeight:' + mheight + 'px;dialogWidth:' + mwidth + 'px;dialogLeft:' + loc_x + ';dialogTop:' + loc_y + ';help:no;status:no;scroll:yes;titlebar:no;toolbar:no');
  

        }

        function change_type(type_id)
        {
         window.location="index1.aspx?type_id="+type_id;
        }

		</script>
	</HEAD>
	<body class="bodycolor" style="padding-top:0;" >
		<form id="Form1" method="post" runat="server">
         <div class="main_div">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="tab_ti"  width="40%"><span class="big3">
							公告通知</span>
					<SELECT id="ddlTypeId" name="ddlTypeId" runat="server" DataTextField="TypeName" DataValueField="TypeId" class="BigSelect">
					</SELECT>
					</td>
					<td vAlign="bottom" width="20%"><asp:literal id="litNavCount" runat="server"></asp:literal></td>
					<td vAlign="bottom" width="40%"><asp:literal id="litNavPager" runat="server"></asp:literal></td>
				</tr>
			</table>			
			<asp:Panel id="pnlMain" runat="server"><br>
					<ASP:REPEATER id="rptNotify" runat="server" EnableViewState="False">
					<HeaderTemplate>
						<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0" class="tab_pub" align="center">
						<tr>						
								<Th noWrap align="center" width="30%">标题</Th>
								<Th noWrap align="center">类型</Th>
								<Th noWrap align="center">发送范围</Th>
								<Th noWrap align="center">发布人</Th>
								<Th noWrap align="center">发布时间</Th>						
						</tr>
					</HeaderTemplate>
					<ItemTemplate>
						<tr class="TableLine1">
							<td>
							<a href="javascript:open_notify('<%#Eval("NotifyId")%>');"><span style="<%# (Convert.ToBoolean(Eval("Important").ToString()) == true) ? "font-weight: bold;color: #FF0000;" : ""%>"><%#Eval("Subject")%></span></a><%#Eval("Readers") != DBNull.Value ? GetNew(Eval("Readers").ToString()) : "<img src=/images/new.gif align=absmiddle>"%>
							</td>
							<td align="center" nowrap><%#Eval("TypeName")%></td>
							<td>
								<%#Eval("ToDeptNames").ToString() != string.Empty ? "<font color=#0000FF><b>部门：</b></font>" + Eval("ToDeptNames").ToString()  + "<br>": ""%>
									<%#Eval("ToPrivNames").ToString() != string.Empty ? "<font color=#0000FF><b>角色：</b></font>" + Eval("ToPrivNames").ToString() + "<br>" : ""%>
									<%#Eval( "ToUser").ToString() != string.Empty ? "<font color=#0000FF><b>人员：</b></font>" + GetUserNames(Eval( "ToUser").ToString()) : ""%>
							</td>
							<td nowrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="CURSOR:hand"><%#Eval("UserName")%></u></td>
							<td noWrap align="center"><%#Eval("SendTime")%></td>
						</tr>
					</ItemTemplate>
					<AlternatingItemTemplate>
						<tr class="TableLine2">
							<td>
							<a href="javascript:open_notify('<%#Eval("NotifyId")%>');"><span style="<%# (Convert.ToBoolean(Eval("Important").ToString()) == true) ? "font-weight: bold;color: #FF0000;" : ""%>"><%#Eval("Subject")%></span></a><%#Eval("Readers") != DBNull.Value ? GetNew(Eval("Readers").ToString()) : "<img src=/images/new.gif align=absmiddle>"%>
							</td>
							<td align="center" nowrap><%#Eval("TypeName")%></td>
							<td>
								<%#Eval("ToDeptNames").ToString() != string.Empty ? "<font color=#0000FF><b>部门：</b></font>" + Eval("ToDeptNames").ToString()  + "<br>": ""%>
									<%#Eval("ToPrivNames").ToString() != string.Empty ? "<font color=#0000FF><b>角色：</b></font>" + Eval("ToPrivNames").ToString() + "<br>" : ""%>
									<%#Eval( "ToUser").ToString() != string.Empty ? "<font color=#0000FF><b>人员：</b></font>" + GetUserNames(Eval( "ToUser").ToString()) : ""%>
							</td>
							<td nowrap align="center"><u title="部门：<%#Eval("DeptName")%>" style="CURSOR:hand"><%#Eval("UserName")%></u></td>
							<td noWrap align="center"><%#Eval("SendTime")%></td>
						</tr>
					</AlternatingItemTemplate>
					<FooterTemplate>
						</TABLE>
					</FooterTemplate>
					</ASP:REPEATER>
					<div class="div_cotr">
							<Webdiver:AspNetPager id="AspNetPager1" runat="server" CssClass="small1" InputBoxClass="SmallInput" SubmitButtonClass="bnt05"
								Font-Size="10pt" OnPageChanged="ChangePage" HorizontalAlign="Right" ShowCustomInfoSection="left" ShowInputBox="Always"
								SubmitButtonText="转 到" NumericButtonTextFormatString="[{0}]" UrlPaging="True" CustomInfoSectionWidth="35%"
								PagingButtonSpacing="0" ImagePath="../images" ButtonImageNameExtension="n" CpiButtonImageNameExtension="r"
								DisabledButtonImageNameExtension="g" PageSize="10" AlwaysShow="True"></Webdiver:AspNetPager>
								<div style="clear:both;"></div>
				</div>
			</asp:Panel>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
            </div>
		</form>
	</body>
</HTML>
